import { ref, inject } from 'vue';
import { columnWrapperKey } from '../table-column/table-column-wrapper';

export function useExtraDisabled($props: any) {
  const isDisabled = ref(false);

  if ($props.disabled === undefined) {
    const columnWrapper = inject(columnWrapperKey);
    // console.log('columnWrapper', columnWrapper);
    if (columnWrapper?.state === 'edit') {
      isDisabled.value = false;
    } else {
      isDisabled.value = true;
    }
  }

  return isDisabled;
}
